package test1225;


public class Test10 {
    public static void main(String[] args) {
        // 返回数组中偶数
        int[] arr = {4,5,6,7,8,9};
        int[] brr = m10(arr);
        for (int b:brr) {
            System.out.println(b);
        }
    }
    public static int[] m10(int[] arr){
        int[] resoult = new int[arr.length];
        int jiao = 0;
        for(int i=0 ;i<arr.length;i++){
            if(arr[i]%2==0){
                resoult[jiao]=arr[i];
                jiao++;
            }
        }
        int[] newresoult = new int[jiao];
        for(int i=0;i<jiao;i++){
            newresoult[i]=resoult[i];
        }
        return newresoult;
    }
}